package com.ycw.cs.common.response;

/**
 * 用于分页查询的数据类
 */
public class PageInfo {

    /**
     * 查询的页数
     */
    private Integer pageNo;
    /**
     *每页查询的数量
     */
    private Integer pageSize;
    /**
     * 总页数
     */
    private Integer totalPage;
    /**
     * 总记录数
     */
    private Integer totalSize;

    public PageInfo() {
    }

    public PageInfo(Integer pageNo, Integer pageSize, Integer totalSize) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.totalSize = totalSize;

        //计算总页数
        if(this.totalSize % this.pageSize ==0){
            this.totalPage=this.totalSize/this.pageSize;
        }else{
            this.totalPage=this.totalSize/this.pageSize+1;
        }
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public Integer getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(Integer totalSize) {
        this.totalSize = totalSize;
    }
}
